#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
from os.path import join, getsize
for root, dirs, files in os.walk('E:\learning\practice_all\json'):
    # 打印出目录名
    print(root, "consumes", end=" ")
    print(sum(getsize(join(root, name)) for name in files), end=" ")
    print("bytes in", len(files), "non-directory files")
    if 'CVS' in dirs:
        dirs.remove('CVS')  # 不遍历CVS目录